
export default {
    namespaced: true,
    state: {
        componentName: '',
        modalShow: false,
        scrollTop1:0,
    },
    mutations: {
        updateComponentName(state, val) {
            state.componentName = val
        },
        updateLoginShow(state, val) {
            state.modalShow = val
        },
        showComponentName(state, componentName) {
            let documentTop = document.scrollingElement.scrollTop;
            state.scrollTop1 = documentTop
            // console.log('....showComponentName',componentName,this);

            this.commit('modal/updateComponentName', componentName)
            this.commit('modal/updateLoginShow', true)
            
            // console.log(this._vm,'vm');
            this._vm.$nextTick(() => {
                document.body.style.position = "fixed"
                document.body.style.top = -state.scrollTop1 + "px";
            })
        },
        closeLoginModal(state) {
            console.log('closeLoginModal');
            state.componentName = ''
            state.modalShow = false
        }
    },
    actions: {

    },
    getters: {

    }
}